/**
 * 北京中流科技有限公司 版权所有
 * http://www.chinasoa.com.cn
 */
package cn.com.chinasoa.course.subscribe;

import java.io.IOException;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;

import cn.com.chinasoa.course.subscribe.util.DataTypeUtil;

import com.x4ee.soa.portal.framework.core.ActionConfig;
import com.x4ee.soa.portal.framework.core.ActionFilter;
import com.x4ee.soa.portal.framework.core.BaseRequestFilter;

/**
 * @author 刘洋(liuyang@chinasoa.com.cn)
 * 2007-11-5上午12:07:47
 */
public class SubscribeOrderQueryActionFilter extends BaseRequestFilter
	implements ActionFilter {
	
	private static String SUCCESS = "success";
	private static String FAILED = "error";
	
	public String process(ActionRequest actionRequest, ActionResponse actionResponse,
			ActionConfig actionConfig) throws PortletException, IOException {
		String orderId = actionRequest.getParameter("orderId");
		
		boolean success = false;
		if(orderId!=null){
			long orderIdLong = DataTypeUtil.parseLong(orderId);
			if(orderIdLong>=0){
				SubscribeOrderCreateActionFilter.setOrderId(orderIdLong,actionRequest);
				success=true;
			}
		}
		if(success)return SUCCESS;
		else return FAILED;
	}
}
